package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Square {
    public static void main(String[] args) {
        //输出用*组成的长方形
        Scanner sc = new Scanner(System.in);
        //***
        //***
        System.out.println("请输入宽度：");
        int w = sc.nextInt();
        System.out.println("请输入高度：");
        int h = sc.nextInt();
        if (w >= 3 && h >= 3) {
            for (int i = 1; i <= h; i++) {
                for (int j = 1; j <= w; j++) {
                    if (i == 1 || i == h || j == 1 || j == w)
                        System.out.print("* ");
                    else
                        System.out.print("  ");
                }
                System.out.println();
            }
        } else {
            System.out.println("宽高太短");
        }

    }
}
